//Kappy; Class program
//Class.cpp : Definitions go here

#include "Class.h"; //Don't forget this!!!

//In the .cpp, we declare all of our constructors, methods, and the desctructor.
Dog::Dog() //DEFAULT Constructor
{
	name = "Default Dog"; 
	age = 1;
	energyLevel = 20;
	weight = 500000000.2; 
	cout << "A default dog has been created.\n";
}

//This is the actual constructor, not the DEFAULT.
Dog::Dog(string newName, int newAge, int newEnergyLevel, double newWeight)
{
	//What this constructor does is assign name the value
	//of newName, etc..
	name = newName;
	age = newAge;
	energyLevel = newEnergyLevel;
	weight = newWeight;
	cout << "A new dog, " << name << ", has been created!\n";
}

void Dog::Bark()
{
	cout << name << " is barking!\n";
}

void Dog::Eat()
{
	cout << name << " is eating.\n";
	energyLevel += 1;
	weight += 0.5;
}

//Sleep function goes here
void Dog::Sleep()
{
	cout << name << " is sleeping.\n";
	energyLevel += 1.5; 
	weight -= .02;
	//You guys can make these whatever you want, yo
}

//Destructor
Dog::~Dog()
{
	age = 0;
	energyLevel = 0;
	weight = 0;
	cout << name << " is now living on a farm far away.\n";
}

int Dog::getAge()
{
	return age; 
}

int Dog::getEnergy()
{
	return energyLevel; 
}
int Dog::getDogYears()
{
	return	7 * age;
}

void Dog::setAge(int val)
{
	//purpose is to set things 
	//if they fail then it does nothing
	if (val <= 20 && val >= 0) 
	{		//checks if age is 0-20
			//if less than 20 and more or equal to 20 
			// the val is set to age
		age = val;
	}
	else 
	{
		cout<<"Invalid entry."<< endl;
		cout<<"Please enter an age between 0-20 later."<< endl;
	}
}

void Dog::setEnergy(int val)
{
	if(val >= 0)	
	{
		energyLevel = val;	
	}
	//no else because we don't need it 
	//could put a message put no necessary 
}
